'''
	Contains a Cube geom.
	
	@author: J.H.Donker
	@copyright: Twente University
'''
import vtk
import wx

from wx.lib.pubsub import Publisher
from HeaDSETGeom import *

class HeaDSETCube(HeaDSETGeom):
	
	# default properties
	#DEFSIZE = { 'length': 1.00 }
	
	#constructor
	def __init__(self, label = HeaDSETGeom.BOX):
		'''
			This geom is a cube. 
			
			@param label: The desired label. Defaults to HeaDSETGeom.BOX.
		'''	
		cube = vtk.vtkCubeSource()
		cube.SetXLength(self.DEFSIZE['length'])
		cube.SetYLength(self.DEFSIZE['length'])
		cube.SetZLength(self.DEFSIZE['length'])
		
		# create poly mapper
		cubeMapper = vtk.vtkPolyDataMapper()
		cubeMapper.SetInput(cube.GetOutput())
		
		# create actor
		actor = HeaDSETVTKActor()
		actor.SetMapper(cubeMapper)
		actor.SetGeom(self)
		
		# call super constructor
		HeaDSETGeom.__init__(self, actor, label)
		
	def TypeCopy(self):
		'''
			Returns a new HeaDSETCube.
				
			@return: Fresh HeaDSETCube.
		'''
		clone = HeaDSETCube(self.GetLabel())
		return clone
